home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / DShowIDL / vmr9.idl < prev    next >
Encoding:
Text File  |  2002-11-12  |  30.8 KB  |  1,042 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Public Interfaces for the DX9 Video Mixing Renderer DShow filter
  4. //
  5. // Copyright (c) 1999 - 2002, Microsoft Corporation.  All rights reserved.
  6. ///////////////////////////////////////////////////////////////////////////////
  7.  
  8. import "unknwn.idl";
  9.  
  10.  
  11. cpp_quote("#if 0")
  12. // This is temporary work around to persuade
  13. // MIDL to allow forward declarations.
  14. typedef DWORD           IDirect3DDevice9;
  15. typedef DWORD           IDirect3DSurface9;
  16. typedef DWORD           D3DFORMAT;
  17. typedef DWORD           D3DCOLOR;
  18. typedef DWORD           D3DPOOL;
  19. typedef LONGLONG        REFERENCE_TIME;
  20. typedef DWORD*          HMONITOR;
  21. typedef struct {DWORD dw1; DWORD dw2;} AM_MEDIA_TYPE;
  22. cpp_quote ("#endif")
  23.  
  24.  
  25. // public interfaces supported by the VMR9
  26.  
  27. interface IVMRSurface9;
  28.  
  29. interface IVMRSurfaceAllocator9;
  30. interface IVMRSurfaceAllocatorNotify9;
  31. interface IVMRImagePresenter9;
  32. interface IVMRImagePresenterConfig9;
  33. interface IVMRMonitorConfig9;
  34. interface IVMRWindowlessControl9;
  35.  
  36. interface IVMRMixerControl9;
  37. interface IVMRImageCompositor9;
  38. interface IVMRMixerBitmap9;
  39.  
  40.  
  41. interface IVMRFilterConfig9;
  42. interface IVMRAspectRatioControl9;
  43. interface IVMRVideoStreamControl9;
  44.  
  45.  
  46.  
  47.  
  48. ///////////////////////////////////////////////////////////////////////////////
  49. //
  50. // Allocator Presenter interfaces
  51. //
  52. ///////////////////////////////////////////////////////////////////////////////
  53.  
  54.  
  55.  
  56. //=====================================================================
  57. //
  58. // IVMRImagePresenter9
  59. //
  60. //=====================================================================
  61. typedef enum {
  62.     VMR9Sample_SyncPoint       = 0x00000001,
  63.     VMR9Sample_Preroll         = 0x00000002,
  64.     VMR9Sample_Discontinuity   = 0x00000004,
  65.     VMR9Sample_TimeValid       = 0x00000008,
  66. } VMR9PresentationFlags;
  67.  
  68.  
  69. typedef struct _VMR9PresentationInfo {
  70.     DWORD                   dwFlags;
  71.     IDirect3DSurface9*      lpSurf;
  72.     REFERENCE_TIME          rtStart;
  73.     REFERENCE_TIME          rtEnd;
  74.     SIZE                    szAspectRatio;
  75.     RECT                    rcSrc;
  76.     RECT                    rcDst;
  77.     DWORD                   dwReserved1;
  78.     DWORD                   dwReserved2;
  79. } VMR9PresentationInfo;
  80.  
  81. [
  82.     local,
  83.     object,
  84.     local,
  85.     uuid(69188c61-12a3-40f0-8ffc-342e7b433fd7),
  86.     helpstring("IVMRImagePresenter9 Interface"),
  87.     pointer_default(unique)
  88. ]
  89. interface IVMRImagePresenter9 : IUnknown
  90. {
  91.     HRESULT StartPresenting(
  92.         [in] DWORD_PTR dwUserID
  93.         );
  94.  
  95.     HRESULT StopPresenting(
  96.         [in] DWORD_PTR dwUserID
  97.         );
  98.  
  99.     HRESULT PresentImage(
  100.         [in] DWORD_PTR dwUserID,
  101.         [in] VMR9PresentationInfo* lpPresInfo
  102.         );
  103. };
  104.  
  105.  
  106. //=====================================================================
  107. //
  108. // IVMRSurfaceAllocator
  109. //
  110. //=====================================================================
  111. typedef enum {
  112.     // surface types/usage
  113.     VMR9AllocFlag_3DRenderTarget        = 0x0001,
  114.     VMR9AllocFlag_DXVATarget            = 0x0002,
  115.  
  116.     //
  117.     // VMR9AllocFlag_TextureSurface can be combined with
  118.     // DXVATarget and 3DRenderTarget
  119.     //
  120.     VMR9AllocFlag_TextureSurface        = 0x0004,
  121.     VMR9AllocFlag_OffscreenSurface      = 0x0008,
  122.     VMR9AllocFlag_UsageReserved         = 0x00F0,
  123.     VMR9AllocFlag_UsageMask             = 0x00FF
  124.  
  125.     // surface
  126. } VMR9SurfaceAllocationFlags;
  127.  
  128.  
  129. typedef struct _VMR9AllocationInfo {
  130.     DWORD                   dwFlags;    // see VMR9SurfaceAllocationFlags
  131.     DWORD                   dwWidth;
  132.     DWORD                   dwHeight;
  133.     D3DFORMAT               Format;     // 0 means use a format compatible with the display
  134.     D3DPOOL                 Pool;
  135.     DWORD                   MinBuffers;
  136.     SIZE                    szAspectRatio;
  137.     SIZE                    szNativeSize;
  138. } VMR9AllocationInfo;
  139.  
  140. [
  141.     local,
  142.     object,
  143.     local,
  144.     uuid(8d5148ea-3f5d-46cf-9df1-d1b896eedb1f),
  145.     helpstring("IVMRSurfaceAllocator9 Interface"),
  146.     pointer_default(unique)
  147. ]
  148. interface IVMRSurfaceAllocator9 : IUnknown
  149. {
  150.     HRESULT InitializeDevice(
  151.         [in] DWORD_PTR dwUserID,
  152.         [in] VMR9AllocationInfo* lpAllocInfo,
  153.         [in, out] DWORD* lpNumBuffers
  154.         );
  155.  
  156.     HRESULT TerminateDevice(
  157.         [in] DWORD_PTR dwID
  158.         );
  159.  
  160.     HRESULT GetSurface(
  161.         [in] DWORD_PTR dwUserID,
  162.         [in] DWORD SurfaceIndex,
  163.         [in] DWORD SurfaceFlags,
  164.         [out] IDirect3DSurface9** lplpSurface
  165.         );
  166.  
  167.     HRESULT AdviseNotify(
  168.         [in] IVMRSurfaceAllocatorNotify9* lpIVMRSurfAllocNotify
  169.         );
  170. };
  171.  
  172.  
  173. //=====================================================================
  174. //
  175. // IVMRSurfaceAllocatorNotify9
  176. //
  177. //=====================================================================
  178. [
  179.     local,
  180.     object,
  181.     local,
  182.     uuid(dca3f5df-bb3a-4d03-bd81-84614bfbfa0c),
  183.     helpstring("IVMRSurfaceAllocatorNotify9 Interface"),
  184.     pointer_default(unique)
  185. ]
  186. interface IVMRSurfaceAllocatorNotify9 : IUnknown
  187. {
  188.     HRESULT AdviseSurfaceAllocator(
  189.         [in] DWORD_PTR dwUserID,
  190.         [in] IVMRSurfaceAllocator9* lpIVRMSurfaceAllocator
  191.         );
  192.  
  193.     HRESULT SetD3DDevice(
  194.         [in] IDirect3DDevice9* lpD3DDevice,
  195.         [in] HMONITOR hMonitor
  196.         );
  197.  
  198.     HRESULT ChangeD3DDevice(
  199.         [in] IDirect3DDevice9* lpD3DDevice,
  200.         [in] HMONITOR hMonitor
  201.         );
  202.  
  203.     HRESULT AllocateSurfaceHelper(
  204.         [in] VMR9AllocationInfo* lpAllocInfo,
  205.         [in, out] DWORD* lpNumBuffers,
  206.         [out] IDirect3DSurface9** lplpSurface
  207.         );
  208.  
  209.     HRESULT NotifyEvent(
  210.         [in] LONG EventCode,
  211.         [in] LONG_PTR Param1,
  212.         [in] LONG_PTR Param2
  213.         );
  214. };
  215.  
  216.  
  217.  
  218. ///////////////////////////////////////////////////////////////////////////////
  219. //
  220. // Application control and configuration interfaces
  221. //
  222. ///////////////////////////////////////////////////////////////////////////////
  223.  
  224.  
  225. //=====================================================================
  226. //
  227. // IVMRWindowlessControl9
  228. //
  229. //=====================================================================
  230. typedef enum {
  231.     VMR9ARMode_None,
  232.     VMR9ARMode_LetterBox
  233. } VMR9AspectRatioMode;
  234.  
  235. [
  236.     local,
  237.     object,
  238.     local,
  239.     uuid(8f537d09-f85e-4414-b23b-502e54c79927),
  240.     helpstring("IVMRWindowlessControl Interface"),
  241.     pointer_default(unique)
  242. ]
  243. interface IVMRWindowlessControl9 : IUnknown
  244. {
  245.     //
  246.     //////////////////////////////////////////////////////////
  247.     // Video size and position information
  248.     //////////////////////////////////////////////////////////
  249.     //
  250.     HRESULT GetNativeVideoSize(
  251.         [out] LONG* lpWidth,
  252.         [out] LONG* lpHeight,
  253.         [out] LONG* lpARWidth,
  254.         [out] LONG* lpARHeight
  255.         );
  256.  
  257.     HRESULT GetMinIdealVideoSize(
  258.         [out] LONG* lpWidth,
  259.         [out] LONG* lpHeight
  260.         );
  261.  
  262.     HRESULT GetMaxIdealVideoSize(
  263.         [out] LONG* lpWidth,
  264.         [out] LONG* lpHeight
  265.         );
  266.  
  267.     HRESULT SetVideoPosition(
  268.         [in] const LPRECT lpSRCRect,
  269.         [in] const LPRECT lpDSTRect
  270.         );
  271.  
  272.     HRESULT GetVideoPosition(
  273.         [out] LPRECT lpSRCRect,
  274.         [out] LPRECT lpDSTRect
  275.         );
  276.  
  277.     HRESULT GetAspectRatioMode(
  278.         [out] DWORD* lpAspectRatioMode
  279.         );
  280.  
  281.     HRESULT SetAspectRatioMode(
  282.         [in] DWORD AspectRatioMode
  283.         );
  284.  
  285.     //
  286.     //////////////////////////////////////////////////////////
  287.     // Display and clipping management
  288.     //////////////////////////////////////////////////////////
  289.     //
  290.     HRESULT SetVideoClippingWindow(
  291.         [in] HWND hwnd
  292.         );
  293.  
  294.     HRESULT RepaintVideo(
  295.         [in] HWND hwnd,
  296.         [in] HDC hdc
  297.         );
  298.  
  299.     HRESULT DisplayModeChanged();
  300.  
  301.  
  302.     //
  303.     //////////////////////////////////////////////////////////
  304.     // GetCurrentImage
  305.     //
  306.     // Returns the current image being displayed.  This images
  307.     // is returned in the form of packed Windows DIB.
  308.     //
  309.     // GetCurrentImage can be called at any time, also
  310.     // the caller is responsible for free the returned memory
  311.     // by calling CoTaskMemFree.
  312.     //
  313.     // Excessive use of this function will degrade video
  314.     // playback performed.
  315.     //////////////////////////////////////////////////////////
  316.     //
  317.     HRESULT GetCurrentImage(
  318.         [out] BYTE** lpDib
  319.         );
  320.  
  321.     //
  322.     //////////////////////////////////////////////////////////
  323.     // Border Color control
  324.     //
  325.     // The border color is color used to fill any area of the
  326.     // the destination rectangle that does not contain video.
  327.     // It is typically used in two instances.  When the video
  328.     // straddles two monitors and when the VMR is trying
  329.     // to maintain the aspect ratio of the movies by letter
  330.     // boxing the video to fit within the specified destination
  331.     // rectangle. See SetAspectRatioMode above.
  332.     //////////////////////////////////////////////////////////
  333.     //
  334.     HRESULT SetBorderColor(
  335.         [in] COLORREF Clr
  336.         );
  337.  
  338.     HRESULT GetBorderColor(
  339.         [out] COLORREF* lpClr
  340.         );
  341. };
  342.  
  343.  
  344.  
  345. //=====================================================================
  346. //
  347. // IVMRMixerControl9
  348. //
  349. //=====================================================================
  350.  
  351. typedef enum {
  352.     MixerPref9_NoDecimation             = 0x00000001, // No decimation - full size
  353.     MixerPref9_DecimateOutput           = 0x00000002, // decimate output by 2 in x & y
  354.     MixerPref9_DecimationReserved       = 0x0000000C, // bits reserved for future use.
  355.     MixerPref9_DecimateMask             = 0x0000000F,
  356.  
  357.     MixerPref9_BiLinearFiltering        = 0x00000010, // use bi-linear filtering
  358.     MixerPref9_PointFiltering           = 0x00000020, // use point filtering
  359.     MixerPref9_AnisotropicFiltering     = 0x00000040, //
  360.     MixerPref9_PyramidalQuadFiltering   = 0x00000080, // 4-sample tent
  361.     MixerPref9_GaussianQuadFiltering    = 0x00000100, // 4-sample gaussian
  362.     MixerPref9_FilteringReserved        = 0x00000E00, // bits reserved for future use.
  363.     MixerPref9_FilteringMask            = 0x00000FF0, // OR of all above flags
  364.  
  365.     MixerPref9_RenderTargetRGB          = 0x00001000,
  366.     MixerPref9_RenderTargetReserved     = 0x000FE000, // bits reserved for future use.
  367.     MixerPref9_RenderTargetMask         = 0x000FF000, // OR of all above flags
  368. } VMR9MixerPrefs;
  369.  
  370.  
  371. //
  372. //  Normalized relative rectangle
  373. //  Coordinate ranges: x=[0...1) y=[0...1)
  374. //  Where the output window goes from 0,0 (closed inclusive lower bound)
  375. //  to 1,1 (open exclusive upper bound)
  376. //
  377. typedef struct _VMR9NormalizedRect
  378. {
  379.     float left;
  380.     float top;
  381.     float right;
  382.     float bottom;
  383. } VMR9NormalizedRect;
  384.  
  385.  
  386.  
  387. typedef enum {
  388.     ProcAmpControl9_Brightness            = 0x00000001,
  389.     ProcAmpControl9_Contrast              = 0x00000002,
  390.     ProcAmpControl9_Hue                   = 0x00000004,
  391.     ProcAmpControl9_Saturation            = 0x00000008,
  392.     ProcAmpControl9_Mask                  = 0x0000000F
  393. } VMR9ProcAmpControlFlags;
  394.  
  395. typedef struct _VMR9ProcAmpControl
  396. {
  397.     DWORD       dwSize;
  398.     DWORD       dwFlags;
  399.     float       Brightness;
  400.     float       Contrast;
  401.     float       Hue;
  402.     float       Saturation;
  403. } VMR9ProcAmpControl;
  404.  
  405. typedef struct _VMR9ProcAmpControlRange
  406. {
  407.     DWORD                       dwSize;
  408.     VMR9ProcAmpControlFlags     dwProperty; // see VMR9ProcAmpControlFlags above
  409.     float                       MinValue;
  410.     float                       MaxValue;
  411.     float                       DefaultValue;
  412.     float                       StepSize;
  413. } VMR9ProcAmpControlRange;
  414.  
  415.  
  416. [
  417.     local,
  418.     object,
  419.     local,
  420.     uuid(1a777eaa-47c8-4930-b2c9-8fee1c1b0f3b),
  421.     helpstring("IVMRMixerControl9 Interface"),
  422.     pointer_default(unique)
  423. ]
  424. interface IVMRMixerControl9 : IUnknown
  425. {
  426.     HRESULT SetAlpha(
  427.         [in] DWORD dwStreamID,
  428.         [in] float Alpha // Source alpha premultication factor (global alpha for source)
  429.         );
  430.  
  431.     HRESULT GetAlpha(
  432.         [in] DWORD dwStreamID,
  433.         [out] float* pAlpha
  434.         );
  435.  
  436.     HRESULT SetZOrder(
  437.         [in] DWORD dwStreamID,
  438.         [in] DWORD dwZ
  439.         );
  440.  
  441.     HRESULT GetZOrder(
  442.         [in] DWORD dwStreamID,
  443.         [out] DWORD* pZ
  444.         );
  445.  
  446.     HRESULT SetOutputRect(
  447.         [in] DWORD dwStreamID,
  448.         [in] const VMR9NormalizedRect *pRect
  449.         );
  450.  
  451.     HRESULT GetOutputRect(
  452.         [in] DWORD dwStreamID,
  453.         [out] VMR9NormalizedRect *pRect
  454.         );
  455.  
  456.     HRESULT SetBackgroundClr(
  457.         [in] COLORREF ClrBkg
  458.         );
  459.  
  460.     HRESULT GetBackgroundClr(
  461.         [in] COLORREF* lpClrBkg
  462.         );
  463.  
  464.     HRESULT SetMixingPrefs(
  465.         [in] DWORD dwMixerPrefs  // a combination of VMRMixingPrefFlags
  466.         );
  467.  
  468.     HRESULT GetMixingPrefs(
  469.         [out] DWORD* pdwMixerPrefs
  470.         );
  471.  
  472.     HRESULT SetProcAmpControl(
  473.         [in] DWORD dwStreamID,
  474.         [in] VMR9ProcAmpControl* lpClrControl
  475.         );
  476.  
  477.     HRESULT GetProcAmpControl(
  478.         [in] DWORD dwStreamID,
  479.         [in, out] VMR9ProcAmpControl* lpClrControl
  480.         );
  481.  
  482.     HRESULT GetProcAmpControlRange(
  483.         [in] DWORD dwStreamID,
  484.         [in, out] VMR9ProcAmpControlRange* lpClrControl
  485.         );
  486. };
  487.  
  488.  
  489. //=====================================================================
  490. //
  491. // IVMRMixerBitmap9
  492. //
  493. //=====================================================================
  494.  
  495. typedef struct _VMR9AlphaBitmap
  496. {
  497.     DWORD               dwFlags;        // flags word
  498.     HDC                 hdc;            // DC for the bitmap to copy
  499.     IDirect3DSurface9*  pDDS;           // D3D surface to copy
  500.     RECT                rSrc;           // rectangle to copy from the DC/DDS
  501.     VMR9NormalizedRect  rDest;          // output rectangle in composition space
  502.     FLOAT               fAlpha;         // opacity of the bitmap
  503.     COLORREF            clrSrcKey;      // src color key
  504.     DWORD               dwFilterMode;   // See "SetMixerPrefs"
  505. } VMR9AlphaBitmap;
  506.  
  507.  
  508. typedef enum {
  509.  
  510.     // Disable the alpha bitmap for now
  511.     VMR9AlphaBitmap_Disable                     = 0x00000001,
  512.  
  513.     // Take the bitmap from the HDC rather than the DirectDraw surface
  514.     VMR9AlphaBitmap_hDC                         = 0x00000002,
  515.  
  516.     // Take the entire DDraw surface - rSrc is ignored
  517.     VMR9AlphaBitmap_EntireDDS                   = 0x00000004,
  518.  
  519.     // Indicates that the clrTrans value is valid and should be
  520.     // used when blending
  521.     VMR9AlphaBitmap_SrcColorKey                 = 0x00000008,
  522.  
  523.     // Indicates that the rSrc rectangle is valid and specifies a
  524.     // sub-rectangle of the of original app image to be blended.
  525.     // Use of this parameter enables "Image Strips"
  526.     VMR9AlphaBitmap_SrcRect                     = 0x00000010,
  527.  
  528.     // Indicates that dwFilterMode parameter is valid and should be
  529.     // used to overide the default filtering method used by the VMR.
  530.     // MixerPref_PointFiltering is particulaly useful for images that
  531.     // contain text and do not need to be stretch prior to blending with
  532.     // the video content.
  533.     VMR9AlphaBitmap_FilterMode                  = 0x00000020
  534. } VMR9AlphaBitmapFlags;
  535.  
  536. [
  537.     object,
  538.     local,
  539.     uuid(ced175e5-1935-4820-81bd-ff6ad00c9108),
  540.     helpstring("IVMRMixerBitmap Interface"),
  541.     pointer_default(unique)
  542. ]
  543. interface IVMRMixerBitmap9 : IUnknown
  544. {
  545.     // Set bitmap, location to blend it, and blending value
  546.     HRESULT SetAlphaBitmap(
  547.         [in] const VMR9AlphaBitmap* pBmpParms
  548.         );
  549.  
  550.     // Change bitmap location, size and blending value,
  551.     // graph must be running for change to take effect.
  552.     HRESULT UpdateAlphaBitmapParameters(
  553.         [in] const VMR9AlphaBitmap* pBmpParms
  554.         );
  555.  
  556.     // Get bitmap, location to blend it, and blending value
  557.     HRESULT GetAlphaBitmapParameters(
  558.         [out] VMR9AlphaBitmap* pBmpParms
  559.         );
  560. };
  561.  
  562.  
  563.  
  564. //=====================================================================
  565. //
  566. // IVMRSurface9
  567. //
  568. //=====================================================================
  569. [
  570.     local,
  571.     object,
  572.     local,
  573.     uuid(dfc581a1-6e1f-4c3a-8d0a-5e9792ea2afc),
  574.     helpstring("IVMRSurface Interface"),
  575.     pointer_default(unique)
  576. ]
  577. interface IVMRSurface9 : IUnknown
  578. {
  579.     HRESULT IsSurfaceLocked();
  580.  
  581.     HRESULT LockSurface(
  582.         [out] BYTE** lpSurface
  583.         );
  584.  
  585.     HRESULT UnlockSurface();
  586.  
  587.     HRESULT GetSurface(
  588.         [out] IDirect3DSurface9** lplpSurface
  589.         );
  590. };
  591.  
  592.  
  593.  
  594. //=====================================================================
  595. //
  596. // IID_IVMRImagePresenterConfig9 - this interface allows applications
  597. // to configure the default Microsoft provided allocator-presenter
  598. // inorder to simplify the implementation of their own
  599. // allocator-presenter plug-in.
  600. //
  601. //=====================================================================
  602. typedef enum {
  603.     RenderPrefs9_DoNotRenderBorder           = 0x00000001, // app paints color keys
  604.     RenderPrefs9_Mask                        = 0x00000001, // OR of all above flags
  605. } VMR9RenderPrefs;
  606. [
  607.     local,
  608.     object,
  609.     local,
  610.     uuid(45c15cab-6e22-420a-8043-ae1f0ac02c7d),
  611.     helpstring("IVMRImagePresenterConfig9 Interface"),
  612.     pointer_default(unique)
  613. ]
  614.  
  615. interface IVMRImagePresenterConfig9 : IUnknown
  616. {
  617.  
  618.     HRESULT SetRenderingPrefs(
  619.         [in] DWORD dwRenderFlags   // see VMRRenderPrefs for valid flags
  620.         );
  621.  
  622.     HRESULT GetRenderingPrefs(
  623.         [out] DWORD* dwRenderFlags // see VMRRenderPrefs for valid flags
  624.         );
  625.  
  626. }
  627.  
  628.  
  629.  
  630.  
  631. //=====================================================================
  632. //
  633. // IVMRVideoStreamControl9
  634. //
  635. //=====================================================================
  636. [
  637.     object,
  638.     local,
  639.     uuid(d0cfe38b-93e7-4772-8957-0400c49a4485),
  640.     helpstring("IVMRMixerStreamConfig Interface"),
  641.     pointer_default(unique)
  642. ]
  643. interface IVMRVideoStreamControl9: IUnknown
  644. {
  645.  
  646.     HRESULT SetStreamActiveState(
  647.             [in] BOOL fActive
  648.             );
  649.  
  650.     HRESULT GetStreamActiveState(
  651.             [out] BOOL* lpfActive
  652.             );
  653. };
  654.  
  655.  
  656. typedef enum {
  657.     VMR9Mode_Windowed                        = 0x00000001,
  658.     VMR9Mode_Windowless                      = 0x00000002,
  659.     VMR9Mode_Renderless                      = 0x00000004,
  660.  
  661.     // not a valid value to pass to SetRenderMode
  662.     VMR9Mode_Mask                            = 0x00000007, // OR of all above flags
  663. } VMR9Mode;
  664.  
  665. [
  666.     object,
  667.     local,
  668.     uuid(5a804648-4f66-4867-9c43-4f5c822cf1b8),
  669.     helpstring("IVMRFilterConfig9 Interface"),
  670.     pointer_default(unique)
  671. ]
  672. interface IVMRFilterConfig9 : IUnknown
  673. {
  674.     HRESULT SetImageCompositor(
  675.             [in] IVMRImageCompositor9* lpVMRImgCompositor
  676.             );
  677.  
  678.     HRESULT SetNumberOfStreams(
  679.             [in] DWORD dwMaxStreams
  680.             );
  681.  
  682.     HRESULT GetNumberOfStreams(
  683.             [out] DWORD* pdwMaxStreams
  684.             );
  685.  
  686.     HRESULT SetRenderingPrefs(
  687.             [in] DWORD dwRenderFlags  // a combination of VMR9RenderPrefs
  688.             );
  689.  
  690.     HRESULT GetRenderingPrefs(
  691.             [out] DWORD* pdwRenderFlags
  692.             );
  693.  
  694.     HRESULT SetRenderingMode(
  695.             [in] DWORD Mode  // a combination of VMRMode
  696.             );
  697.  
  698.     HRESULT GetRenderingMode(
  699.             [out] DWORD* pMode
  700.             );
  701. }
  702.  
  703. //=====================================================================
  704. //
  705. // IVMRAspectRatioControl9
  706. //
  707. //=====================================================================
  708. [
  709.     object,
  710.     local,
  711.     uuid(00d96c29-bbde-4efc-9901-bb5036392146),
  712.     helpstring("IVMRAspectRatioControl9 Interface"),
  713.     pointer_default(unique)
  714. ]
  715. interface IVMRAspectRatioControl9 : IUnknown
  716. {
  717.     HRESULT GetAspectRatioMode(
  718.         [out] LPDWORD lpdwARMode
  719.             );
  720.  
  721.     HRESULT SetAspectRatioMode(
  722.         [in] DWORD dwARMode
  723.             );
  724. }
  725.  
  726. ///////////////////////////////////////////////////////////////////////////////
  727. //
  728. // VMR Multimon configuration interface
  729. //
  730. ///////////////////////////////////////////////////////////////////////////////
  731. #define VMR9DEVICENAMELEN 32
  732. #define VMR9DEVICEDESCRIPTIONLEN  512
  733.  
  734. typedef struct _VMR9MonitorInfo {
  735.     UINT        uDevID;
  736.     RECT        rcMonitor;
  737.     HMONITOR    hMon;
  738.     DWORD       dwFlags;    // described in MONITORINFOEX, currently only MONITORINFOF_PRIMARY
  739.     wchar_t     szDevice[VMR9DEVICENAMELEN];
  740.     wchar_t     szDescription[VMR9DEVICEDESCRIPTIONLEN];
  741.     LARGE_INTEGER liDriverVersion;
  742.     DWORD       dwVendorId;
  743.     DWORD       dwDeviceId;
  744.     DWORD       dwSubSysId;
  745.     DWORD       dwRevision;
  746.     //
  747. } VMR9MonitorInfo;
  748.  
  749. [
  750.     object,
  751.     local,
  752.     uuid(46c2e457-8ba0-4eef-b80b-0680f0978749),
  753.     helpstring("IVMRMonitorConfig9 Interface"),
  754.     pointer_default(unique)
  755. ]
  756. interface IVMRMonitorConfig9 : IUnknown
  757. {
  758.     // Use this method on a Multi-Monitor system to specify to the
  759.     // mixer filter which Direct Draw driver should be used when connecting
  760.     // to an upstream decoder filter.
  761.     //
  762.     HRESULT SetMonitor(
  763.         [in] UINT uDev
  764.         );
  765.  
  766.     // Use this method to determine the direct draw object that will be used when
  767.     // connecting the  mixer filter to an upstream decoder filter.
  768.     //
  769.     HRESULT GetMonitor(
  770.         [out] UINT *puDev
  771.         );
  772.  
  773.     // Use this method on a multi-monitor system to specify to the
  774.     //  mixer filter the default Direct Draw device to use when
  775.     // connecting to an upstream filter.  The default direct draw device
  776.     // can be overriden for a particular connection by SetMonitor method
  777.     // described above.
  778.     //
  779.     HRESULT SetDefaultMonitor(
  780.         [in] UINT uDev
  781.         );
  782.  
  783.     // Use this method on a multi-monitor system to determine which
  784.     // is the default direct draw device the overlay mixer filter
  785.     // will  use when connecting to an upstream filter.
  786.     //
  787.     HRESULT GetDefaultMonitor(
  788.         [out] UINT* puDev
  789.         );
  790.  
  791.     // Use this method to get a list of Direct Draw device GUIDs and thier
  792.     // associated monitor information that the mixer can use when
  793.     // connecting to an upstream decoder filter.  Passing down a NULL pInfo
  794.     // parameter allows the app to determine the required array size (returned
  795.     // in pdwNumDevices).  Otherwise, dwNumDevices returns the actual
  796.     // number of devices retrieved.
  797.     //
  798.     HRESULT GetAvailableMonitors(
  799.         [out, size_is(dwMaxInfoArraySize)] VMR9MonitorInfo* pInfo,
  800.         [in] DWORD dwMaxInfoArraySize, // in array members
  801.         [out] DWORD* pdwNumDevices // actual number of devices retrieved
  802.         );
  803. };
  804.  
  805.  
  806. //=====================================================================
  807. //
  808. // IVMRDeinterlaceControl
  809. //
  810. // New interfaced introduced into the WindowsXP SP1 release of the VMR.
  811. // This interface allows applications to control the DX-VA deinterlacing
  812. // support provided by the VMR.
  813. //
  814. // The VMR needs to be set into "mixing" mode for this interface to work.
  815. //
  816. // SetDeinterlaceMode is only effective for new connections made to the
  817. // VMR.  It should be noted that the graphics device driver may refuse
  818. // to use the specified deinterlace mode, in which case 3 fallback
  819. // policies are offered by the VMR, these being:
  820. //
  821. //      1. Fallback to the next best mode offered by the driver.
  822. //      2. Fallback to the BOB deinterlace mode.
  823. //      3. Fallback to the WEAVE deinterlace mode (ie. turn deinterlacing off).
  824. //
  825. //=====================================================================
  826.  
  827. typedef enum {
  828.     DeinterlacePref9_NextBest = 0x01,
  829.     DeinterlacePref9_BOB = 0x02,
  830.     DeinterlacePref9_Weave = 0x04,
  831.     DeinterlacePref9_Mask = 0x07
  832. } VMR9DeinterlacePrefs;
  833.  
  834. typedef enum {
  835.  
  836.     // the algorithm is unknown or proprietary
  837.     DeinterlaceTech9_Unknown                = 0x0000,
  838.  
  839.     // the algorithm creates the missing lines by repeating
  840.     // the line either above or below it - this method will look very jaggy and
  841.     // isn't recommended
  842.     DeinterlaceTech9_BOBLineReplicate       = 0x0001,
  843.  
  844.  
  845.     // the algorithm creates the missing lines by vertically stretching each
  846.     // video field by a factor of two, for example by averaging two lines or
  847.     // using a [-1, 9, 9, -1]/16 filter across four lines.
  848.     // Slight vertical adjustments are made to ensure that the resulting image
  849.     // does not "bob" up and down.
  850.     DeinterlaceTech9_BOBVerticalStretch     = 0x0002,
  851.  
  852.     // the pixels in the missing line are recreated by a median filtering operation
  853.     DeinterlaceTech9_MedianFiltering        = 0x0004,
  854.  
  855.     // the pixels in the missing line are recreated by an edge filter.
  856.     // In this process, spatial directional filters are applied to determine
  857.     // the orientation of edges in the picture content, and missing
  858.     // pixels are created by filtering along (rather than across) the
  859.     // detected edges.
  860.     DeinterlaceTech9_EdgeFiltering          = 0x0010,
  861.  
  862.     // the pixels in the missing line are recreated by switching on a field by
  863.     // field basis between using either spatial or temporal interpolation
  864.     // depending on the amount of motion.
  865.     DeinterlaceTech9_FieldAdaptive          = 0x0020,
  866.  
  867.     // the pixels in the missing line are recreated by switching on a pixel by pixel
  868.     // basis between using either spatial or temporal interpolation depending on
  869.     // the amount of motion..
  870.     DeinterlaceTech9_PixelAdaptive          = 0x0040,
  871.  
  872.     // Motion Vector Steering  identifies objects within a sequence of video
  873.     // fields.  The missing pixels are recreated after first aligning the
  874.     // movement axes of the individual objects in the scene to make them
  875.     // parallel with the time axis.
  876.     DeinterlaceTech9_MotionVectorSteered      = 0x0080
  877.  
  878. } VMR9DeinterlaceTech;
  879.  
  880. typedef struct _VMR9Frequency {
  881.     DWORD dwNumerator;
  882.     DWORD dwDenominator;
  883. } VMR9Frequency;
  884.  
  885. typedef enum _VMR9_SampleFormat {
  886.     VMR9_SampleReserved      = 1,
  887.     VMR9_SampleProgressiveFrame = 2,
  888.     VMR9_SampleFieldInterleavedEvenFirst = 3,
  889.     VMR9_SampleFieldInterleavedOddFirst = 4,
  890.     VMR9_SampleFieldSingleEven = 5,
  891.     VMR9_SampleFieldSingleOdd = 6,
  892. } VMR9_SampleFormat;
  893.  
  894. typedef struct _VMR9VideoDesc {
  895.     DWORD               dwSize;
  896.     DWORD               dwSampleWidth;
  897.     DWORD               dwSampleHeight;
  898.     VMR9_SampleFormat   SampleFormat;
  899.     DWORD               dwFourCC;
  900.     VMR9Frequency       InputSampleFreq;
  901.     VMR9Frequency       OutputFrameFreq;
  902. } VMR9VideoDesc;
  903.  
  904.  
  905. typedef struct _VMR9DeinterlaceCaps {
  906.     DWORD               dwSize;
  907.     DWORD               dwNumPreviousOutputFrames;
  908.     DWORD               dwNumForwardRefSamples;
  909.     DWORD               dwNumBackwardRefSamples;
  910.     VMR9DeinterlaceTech DeinterlaceTechnology;
  911. } VMR9DeinterlaceCaps;
  912.  
  913. [
  914.     object,
  915.     local,
  916.     uuid(a215fb8d-13c2-4f7f-993c-003d6271a459),
  917.     helpstring("IVMRDeinterlaceControl9 Interface"),
  918.     pointer_default(unique)
  919. ]
  920. interface IVMRDeinterlaceControl9 : IUnknown
  921. {
  922.     //
  923.     // For the specified video description returns the
  924.     // number of deinterlacing modes available to the VMR.
  925.     // The deinterlacing modes are returned in descending
  926.     // quality order ie. the best quality mode is at
  927.     // lpdwNumDeinterlaceModes[0], the next best at
  928.     // lpdwNumDeinterlaceModes[1] and so on.
  929.     //
  930.     // To determine how big an array of guids to pass to the
  931.     // GetNumberOfDeinterlaceModes method call
  932.     // GetNumberOfDeinterlaceModes(lpVideoDescription, &dwNumModes, NULL);
  933.     //
  934.     HRESULT GetNumberOfDeinterlaceModes(
  935.         [in] VMR9VideoDesc* lpVideoDescription,
  936.         [in] [out] LPDWORD lpdwNumDeinterlaceModes,
  937.         [out] LPGUID lpDeinterlaceModes
  938.         );
  939.  
  940.     //
  941.     // For the given video description get the capabilities of the
  942.     // specified de-interlace mode.
  943.     //
  944.     HRESULT GetDeinterlaceModeCaps(
  945.         [in] LPGUID lpDeinterlaceMode,
  946.         [in] VMR9VideoDesc* lpVideoDescription,
  947.         [out] VMR9DeinterlaceCaps* lpDeinterlaceCaps
  948.         );
  949.  
  950.     //
  951.     // Get/Set the deinterlace mode that you would like the
  952.     // VMR to use when de-interlacing the specified stream.
  953.     // It should be noted that the VMR may not actually be able
  954.     // to use the requested deinterlace mode, in which case the
  955.     // the VMR will fall back to other de-interlace modes as specified
  956.     // by the de-interlace preferences (see SetDeinterlacePrefs below).
  957.     //
  958.     HRESULT GetDeinterlaceMode(
  959.         [in] DWORD dwStreamID,
  960.         [out] LPGUID lpDeinterlaceMode  // returns GUID_NULL if SetDeinterlaceMode
  961.         );                              // has not been called yet.
  962.  
  963.     HRESULT SetDeinterlaceMode(
  964.         [in] DWORD dwStreamID,          // use 0xFFFFFFFF to set mode for all streams
  965.         [in] LPGUID lpDeinterlaceMode   // GUID_NULL == turn deinterlacing off
  966.         );
  967.  
  968.  
  969.     HRESULT GetDeinterlacePrefs(
  970.         [out] LPDWORD lpdwDeinterlacePrefs
  971.         );
  972.  
  973.     HRESULT SetDeinterlacePrefs(
  974.         [in] DWORD dwDeinterlacePrefs
  975.         );
  976.  
  977.     //
  978.     // Get the DeinterlaceMode currently in use for the specified
  979.     // video stream (ie. pin).  The returned GUID will be NULL if
  980.     // the de-interlacing h/w has not been created by the VMR at the
  981.     // time the function is called, or if the VMR determines that
  982.     // this stream should not or can be de-interlaced.
  983.     //
  984.     HRESULT GetActualDeinterlaceMode(
  985.         [in] DWORD dwStreamID,
  986.         [out] LPGUID lpDeinterlaceMode
  987.         );
  988. };
  989.  
  990.  
  991. //=====================================================================
  992. //
  993. // IVMRImageCompositor9
  994. //
  995. //=====================================================================
  996.  
  997. typedef struct _VMR9VideoStreamInfo {
  998.     IDirect3DSurface9*          pddsVideoSurface;
  999.     DWORD                       dwWidth, dwHeight;
  1000.     DWORD                       dwStrmID;
  1001.     FLOAT                       fAlpha;
  1002.     VMR9NormalizedRect          rNormal;
  1003.     REFERENCE_TIME              rtStart;
  1004.     REFERENCE_TIME              rtEnd;
  1005.     VMR9_SampleFormat           SampleFormat;
  1006. } VMR9VideoStreamInfo;
  1007. [
  1008.     local,
  1009.     object,
  1010.     local,
  1011.     uuid(4a5c89eb-df51-4654-ac2a-e48e02bbabf6),
  1012.     helpstring("IVMRImageCompositor9 Interface"),
  1013.     pointer_default(unique)
  1014. ]
  1015. interface IVMRImageCompositor9 : IUnknown
  1016. {
  1017.     HRESULT InitCompositionDevice(
  1018.         [in] IUnknown* pD3DDevice
  1019.         );
  1020.  
  1021.     HRESULT TermCompositionDevice(
  1022.         [in] IUnknown* pD3DDevice
  1023.         );
  1024.  
  1025.     HRESULT SetStreamMediaType(
  1026.         [in] DWORD dwStrmID,
  1027.         [in] AM_MEDIA_TYPE* pmt,
  1028.         [in] BOOL fTexture
  1029.         );
  1030.  
  1031.     HRESULT CompositeImage(
  1032.         [in] IUnknown* pD3DDevice,
  1033.         [in] IDirect3DSurface9* pddsRenderTarget,
  1034.         [in] AM_MEDIA_TYPE* pmtRenderTarget,
  1035.         [in] REFERENCE_TIME rtStart,
  1036.         [in] REFERENCE_TIME rtEnd,
  1037.         [in] D3DCOLOR dwClrBkGnd,
  1038.         [in] VMR9VideoStreamInfo* pVideoStreamInfo,
  1039.         [in] UINT cStreams
  1040.         );
  1041. };
  1042.